#include <EEPROM.h> 

byte byte1=0;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200); 
  Serial.println("");   
  EEPROM.begin(1024);                  //开启EEPROM，开辟1024个位空间  

  //读取与保存byte类型
  EEPROM.write(0,byte1);              //给EEPROM 第0位，写入byte_1的值
  EEPROM.commit();
  byte byte2=EEPROM.read(0);
  Serial.print("byte2的值："); 
  Serial.println(byte2);
}

void loop() {
  // put your main code here, to run repeatedly:

}
